Skip to content

Instantly share code, notes, and snippets.

@audacus
audacus / vanilla-js-ajax.js
Last active May 17, 2024 12:37
Template for making a AJAX request with vanilla JavaScript.
// create request object
var xhttp = new XMLHttpRequest();
// set params
var method = 'GET' || 'DELETE' || 'POST' || 'PUT' || 'PATCH';
var url = 'controller/action';
var asynchronous = true;
// open request
xhttp.open(method, url, asynchronous);
// set ajax headers
xhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
@Klerith
Klerith / configurar-node-ts.md
Last active May 17, 2024 12:37
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@TrevTV
TrevTV / ArcOn10.md
Last active May 17, 2024 12:36
Guide to installing Arc Browser on Windows 10

As this is not an official way of installing Arc, if you encounter any issues do NOT report them to the developers, they did not intend for people to be running Arc on Windows 10.

This guide is a bit more manual since I wanted to respect the developers' wishes and not directly link any downloads to the beta of Arc.

I don't know how this will work with updates, you may just need to redo the process to update it, but I'm not sure

  1. Install this font: https://aka.ms/SegoeFluentIcons (this fixes the icons since Windows 10 doesn't have this font installed by default)
  2. Download the Arc appinstaller and open it in notepad/some other text editor
  3. Copy everything inside and paste it into this website: https://codebeautify.org/xmlviewer (this is optional, but it makes reading and copying from the file easier)
  4. Find the mainpackage @Uri, it should end in Arc.x64.msix, and open that in a new tab. It should download that msix file.
@zellwk
zellwk / deploy.yml
Created August 2, 2023 03:58
Github Actions
# See https://zellwk.com/blog/github-actions-deploy/ an explanation of this code
name: deploy
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
@fbarretto
fbarretto / streamdiffusion-mac.md
Last active May 17, 2024 12:34
StreamDiffusion on a Mac

This is a gist on how to get StreamDiffusion running on a Mac (mps)

  1. Clone the repo

git clone https://github.com/cumulo-autumn/StreamDiffusion.git
  1. Setup the environment

cd StreamDiffusion
@phiresky
phiresky / tune.md
Last active May 17, 2024 12:33
SQLite performance tuning

You can scale a SQLite database to multiple GByte in size and many concurrent readers by applying the below optimizations.

Run these every time you connect to the db

(some are applied permanently, but others are reset on new connection)

pragma journal_mode = WAL;

Instead of writing directly to the db file, write to a write-ahead-log instead and regularily commit the changes. Allows multiple concurrent readers, and can significantly improve performance.

@bitingsock
bitingsock / ytdl-preload.lua
Last active May 17, 2024 12:31
Precache the next entry in your playlist if it is a network source by downloading it to a temp file ahead of time. Change Line 20 to temp directory. It will delete the directory on exit.
----------------------
-- #example ytdl_preload.conf
-- # make sure lines do not have trailing whitespace
-- # ytdl_opt has no sanity check and should be formatted exactly how it would appear in yt-dlp CLI, they are split into a key/value pair on whitespace
-- # at least on Windows, do not escape '\' in temp, just us a single one for each divider
-- #temp=R:\ytdltest
-- #ytdl_opt1=-r 50k
-- #ytdl_opt2=-N 5
-- #ytdl_opt#=etc